﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.ListSpring>" %>
<%@ Import Namespace="nelech.Views.Shared.Code" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	מעיינות - נלך
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="left">
 
  <%Html.RenderAction("AdvertShowThree", "Advert", new { id = 7 });%>
  
</div>
<div id="main">
    <h2>מעיינות</h2>
     <div class="userForm">
            <% using (Html.BeginForm("SearchSpring", "Place"))
               { %>
            <fieldset>
                <legend>חיפוש מעיין:</legend>
                
                <p>
                    <label for="area">
                        אזור:</label>
                    <%= Html.DropDownList("regeon", Utils.CreateRegeonListItems(21)) %>
                   </p><p> <label for="season">
                       עונת נביעה:</label>
                    <%= Html.DropDownList("nevia", Utils.CreateNeviaListItems(1)) %>
                </p>
                 <p><label for="searchString">חיפוש חופשי:</label>
                <%= Html.TextBox("searchString") %></p>
              <p class="floatleft">
                <input type="submit" value="חפש" /></p>
            </fieldset>
            <%} %>
        </div>

  <%foreach (var item in Model.listMaayan)
       {%>
    <fieldset class="recommended">
        <legend>
          <%= Html.ActionLink(item.name, "SpringInfo", new { id = item.id })%>
        </legend>
        <p>
            <% if (item.Image.Count > 0)
               {
                   var images = item.Image.OrderBy(p => p.path);
                   var firstImage = images.First();
                   var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
            %>
           <img  src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>" width="150px" />
            <% } %>
            <%= Html.Encode(item.summary) %>
        </p>
        <p>
            <span class="bold">מפת סימון שבילים: </span>
            <%= Html.Encode(item.Regeon1.id + " - " + item.Regeon1.text) %><br />
            <span class="bold">עונת הנביעה:</span>
            <%= Html.Encode(item.Nevia1.text) %>
           </p>
        <p>
            <%= Html.ActionLink("להרחבה", "SpringInfo" ,new { id = item.id })%></p>
    </fieldset>
    <% } %>
    <br />
    <%= Html.ActionLink("לרשימת כל המעיינות", "AllList", "Home", new {id = 3 },null)%>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="Right" ID="Content4" runat="server"></asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
</asp:Content>
